package com.zhanghe.springboot.controller;


import java.util.List;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zhanghe.springboot.model.TestModel;
import com.zhanghe.springboot.service.testService;

@RestController  
@EnableAutoConfiguration  
public class helloController {  
	private static Logger   logger = LogManager.getLogger(helloController.class.getName());
	@Autowired
	public testService service;
    @RequestMapping("/")  
    String home() {  
        return "Hello Worlds!";  
    }  
      
    @RequestMapping("/hello/{myName}")  
    String index(@PathVariable String myName) {  
    	//service.updateById("1", "failed");
    	logger.debug("hello");
        return "Hello "+service.findByid("1")+"!!!";  
    }  
}